
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!--    页面上面的那条bar-->
    <footer th:fragment="common_head">
        <nav class="navbar navbar-expand-lg navbar-light ">
            <a class="navbar-brand" th:href="@{/index}">佛大叮当</a>
            <button class="navbar-toggler" type="button" data-toggle="collapse"
                    data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
                    aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav mr-auto">
                    <li class="nav-item active">
                        <a class="nav-link" th:href="@{/index}">首页
                            <span class="sr-only">(current)</span></a>
                    </li>
                    <li class="nav-item dropdown" th:if="${user!=null}">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown"
                           role="button"
                           data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
                           th:text="${user.getUsername()}">
                        </a>
                        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                            <a class="dropdown-item" th:href="@{/user/product-manage}">我的闲置</a>
                            <a class="dropdown-item" th:href="@{/user/user-manage}">我的信息</a>
                            <a class="dropdown-item" th:href="@{/user/comment-manage}">我的留言</a>
                            <a class="dropdown-item" th:href="@{/user/announce-manage}">公告</a>
                            <a class="dropdown-item" th:href="@{logout}">退出</a>
                        </div>
                    </li>
                    <li class="nav-item active" th:if="${isAdmin}">
                        <a class="nav-link" th:href="@{/admin/admin-manage}" >后台管理入口
                            <span class="sr-only">(current)</span></a>
                    </li>


                    <li class="nav-item active " th:if="${user==null}">
                        <a class="nav-link" th:href="@{/login}">登录
                            <span
                                    class="sr-only">(current)
			                </span></a>
                    </li>
                    <li class="nav-item active " th:if="${user==null}">
                        <a class="nav-link" th:href="@{/register}">注册
                            <span
                                    class="sr-only">(current)
			                </span></a>
                    </li>

                </ul>
            </div>
        </nav>
    </footer>

<!--    这是用户管理页面左边的bar-->
    <footer th:fragment="user_manager_head">
        <nav class="col-md-2 d-none d-md-block bg-light sideb ar">
            <div class="sidebar-sticky">
                <ul class="nav flex-column">
                    <li class="nav-item">
                        <a class="nav-link"
                           href="https://getbootstrap.com/docs/4.2/examples/dashboard/#">
                            闲置管理 <span class="sr-only">(current)</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link active  text-dark" th:href="@{/user/product-manage}">
                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
                                 viewBox="0 0 24 24" fill="none" stroke="currentColor"
                                 stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                                 class="feather feather-home">
                                <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
                                <polyline points="9 22 9 12 15 12 15 22"></polyline>
                            </svg>
                            闲置管理 <span class="sr-only">(current)</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link text-dark" th:href="@{/user/user-manage}">
                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
                                 viewBox="0 0 24 24" fill="none" stroke="currentColor"
                                 stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                                 class="feather feather-file">
                                <path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path>
                                <polyline points="13 2 13 9 20 9"></polyline>
                            </svg>
                            个人管理
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link text-dark"
                           th:href="@{/user/comment-manage}">
                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
                                 viewBox="0 0 24 24" fill="none" stroke="currentColor"
                                 stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                                 class="feather feather-shopping-cart">
                                <circle cx="9" cy="21" r="1"></circle>
                                <circle cx="20" cy="21" r="1"></circle>
                                <path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
                            </svg>
                            留言管理
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link  text-dark"
                           th:href="@{/user/announce-manage}">
                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
                                 viewBox="0 0 24 24" fill="none" stroke="currentColor"
                                 stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                                 class="feather feather-users">
                                <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
                                <circle cx="9" cy="7" r="4"></circle>
                                <path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
                                <path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
                            </svg>
                            公告
                        </a>
                    </li>
                </ul>
            </div>
        </nav>

    </footer>


</head>
</html>